<%@page import="mindmap.Scenario"%><%@page import="java.io.PrintWriter"%><%@ page contentType="text/html;charset=UTF-8" %><%@ page import="java.sql.*" %><%@ page import="java.sql.DriverManager" %><%@ page import="java.sql.ResultSet" %><% 

mindmap.ObjectDB db = new mindmap.ObjectDB();
try{
	db.initialiseConnexion();
	
	String tested = request.getParameter("tested");
	if(tested==null){
		tested="0";
	}
	
	String succeed = request.getParameter("succeed");
	if(succeed==null){
		succeed="0";
	}
	
	mindmap.Scenario myScenario = new mindmap.Scenario(db, request.getParameter("id"),
			request.getParameter("name"),
			request.getParameter("comment"),
			request.getParameter("description"),
			request.getParameter("business_value"),
			request.getParameter("mindmap_developer"),
			request.getParameter("complexity"),
			tested,
			succeed,
			request.getParameter("fk_userstory_id"));
	
	if(myScenario.editDB()){ 
		out.print("Le scénario a bien été enregistré");
	}else{
		response.setStatus(507,"enregistrement error !");	
	}
	db.closeConnexion();
	
}catch(Exception e){
	response.setStatus(508,"error");	
}
%>

